{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "43033388",
   "metadata": {},
   "source": [
    "# 这里是非极大值抑制。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7f2abc8b",
   "metadata": {},
   "source": [
    "<img src=\"./picture/最大值抑制.png\" alt=\"Drawing\" style=\"width: 500px;\" align=\"left\"/>"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f2683d26",
   "metadata": {},
   "source": [
    "1.在上面的图示中可以看到使用不同的框将被检测的物体框住，含有不同的$Pc$值，$Pc$值越高，你那么检测的效果也就越好\n",
    "\n",
    "2.在上面，我们只找出最大的$Pc$值，其他的都给抑制，也就是忽略，所以这个算法的名字也叫做非最大值抑制。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ae738f73",
   "metadata": {},
   "source": [
    "  <img src=\"./picture/最大1.png\" alt=\"Drawing\" style=\"width: 500px;\" align=\"left\"/>"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "890f4a87",
   "metadata": {},
   "source": [
    "在之前就有这个样子的疑惑了：\n",
    "\n",
    "就是当你把一张图片从3 * 3 细分到19 * 19 ，怎么样才可以提高他的检测率啊...而且分了这么多个格子，每个细小的格子也许都会检测到这个汽车\n",
    "这个时候就要使用非极大值抑制了。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3c4fff24",
   "metadata": {},
   "source": [
    "<img src=\"./picture/最大2.png\" alt=\"Drawing\" style=\"width: 500px;\" align=\"left\"/>"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cca0e7ed",
   "metadata": {},
   "source": [
    "在这里要选择一个$Pc$值最大的框，好像这个$Pc = c_1c_2c_3$,然后再找到比较大的iou值的两个矩阵，把iou值较大的删除掉，就像上面的比较暗的那些矩阵。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ed4626d7",
   "metadata": {},
   "source": [
    "<img src=\"./picture/最大3.png\" alt=\"Drawing\" style=\"width: 500px;\" align=\"left\"/>"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "41ff0af0",
   "metadata": {},
   "source": [
    "上面这张图展示了非极大值抑制的步骤：\n",
    "\n",
    "1.首先上面的值针对了检测一个目标。\n",
    "\n",
    "2.这里含有19 * 19个格子，可能会检测出不同的框，可以规定一个$Pc$阈值和一个$IoU$的阈值，达到了就要删除这个框\n",
    "\n",
    "3.如果是多个检测目标，则要在上述的过程中弄出3个分量，然后分别进行目标检测。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c10b1b23",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
